package com.studyv3.test.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * <p>
 * lb_购买申请/审批
 * </p>
 *
 * @author author
 * @since 2024-05-07
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("lb_apply_product")
@ApiModel(value = "LbApplyProduct对象", description = "lb_购买申请/审批")
public class ApplyProduct implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "批次id")
    @TableField("batch_id")
    private Integer batchId;

    @TableField(exist = false)
    private String batchName;

    @ApiModelProperty(value = "采买商品名")
    @TableField("products_id")
    private Integer productsId;

    @TableField(exist = false)
    private String productsName;

    @ApiModelProperty(value = "采买数量")
    @TableField("amount")
    private Integer amount;

    @ApiModelProperty(value = "申请人")
    @TableField("applicant")
    private Integer applicant;
    @TableField(exist = false)
    private String applicantName;
    @ApiModelProperty(value = "总价")
    @TableField("price")
    private BigDecimal price;

    @ApiModelProperty(value = "申请状态 0 通过 1 未审批 2 未通过 ")
    @TableField("flag")
    private Integer flag;

    @ApiModelProperty(value = "0 未删除 1 删除")
    @TableField("deleted")
    private Integer deleted;

    @TableField("create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @TableField("update_time")
    private LocalDateTime updateTime;
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @TableField(exist = false)
    private LocalDate startTime;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @TableField(exist = false)
    private LocalDate endTime;


    @TableField("reason")
    private String reason;

    @TableField("approval_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime approvalTime;

    @TableField("warehous_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime warehousTime;

    @TableField("warehous_flag")
    private Integer warehousFlag;

    @TableField("approval_user")
    private Integer approvalUser;
}
